<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html lang="zh-cn">
<head>
 	<base href="<%=basePath%>">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title>网站信息</title>  
    <link rel="stylesheet" href="css/pintuer.css">
    <link rel="stylesheet" href="css/admin.css">
    <script src="js/jquery.js"></script>
    <script src="js/pintuer.js"></script>  
    
</head>
<body>
<div class="panel admin-panel">
  <div class="panel-head"><strong class="icon-reorder"> 管理员列表</strong></div>
   <center><font align="center" style="color:red;font-size:20px;">${flag}</font></center>
   <c:remove var="flag"/>
  <table class="table table-hover text-center">
    <tr>
      <th width="5%">管理员账号</th>     
      <th>管理员姓名</th>  
      <th>管理员密码</th>     
      <th width="250">操作</th>
    </tr>
   	<c:forEach items="${alladmin}" var="admin">
	    <tr>
	      <td>${admin.adminid }</td>      
	      <td>${admin.adminname }</td>  
	      <td>${admin.adminpwd }</td>      
	      <td>
	      <div class="button-group">
	       <a class="button border-red" href="javascript:void(0)" onclick="return del(${admin.adminid})"><span class="icon-trash-o"></span> 删除</a>
	      </div>
	      </td>
	    </tr> 
    </c:forEach>
	  
    
  </table>
</div>
<script>
function del(id){
	if(confirm("您确定要删除吗?")){
		var	myid=${admin.adminid};
		if(myid==id){
			alert("不能删除自己哦！");
		}else{
			location.href = "/pcshop/delete.do?adminid="+id;
		}

	}
}

</script>
<div class="panel admin-panel margin-top">
  <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>增加管理员</strong></div>
  <div class="body-content">
    <form method="post" class="form-x" action="insert.do">   
      <input type="hidden" name="id"  value="" />  
      <div class="form-group">
        <div class="label">
          <label>管理员账号：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" id="adminid" name="adminid" value="" data-validate="required:请输入账号" />         
          <div class="tips"></div>
        </div>
      </div> 
      <div class="form-group">
        <div class="label">
          <label>管理员姓名：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" name="adminname" value="" data-validate="required:请输入姓名" />         
          <div class="tips"></div>
        </div>
      </div>
       <div class="form-group">
        <div class="label">
          <label>管理员密码：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" name="adminpwd" value="" data-validate="required:请输入密码"/>         
          <div class="tips"></div>
        </div>
      </div>       
     <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button class="button bg-main icon-check-square-o" type="submit"> 提交</button>
        </div>
      </div>
    </form>
  </div>
</div>
</body></html>